package cc.eddic.pratice.programmingparadigms.exam.domain;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public class Category {
    public Category(String name) {
        this.name = name;
        subCategories = new ArrayList<>();
    }

    public Category add(SubCategory subCategory) {
        subCategory.setCategory(this);
        subCategories.add(subCategory);
        return this;
    }

    private final String name;
    private final List<SubCategory> subCategories;
}
